import { INIT_LIST_ACTION } from './actionTypes';

const defaultState = {
  value: '',
};

export default (state = defaultState, action: any) => {
  if (action.type === INIT_LIST_ACTION) {
    const newState = JSON.parse(JSON.stringify(state));
    newState.value = JSON.stringify(action.data);
    return newState;
  }
  return state;
};
